/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_Studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#include <stdafx.h>

#include "ui从属性数据创建组件.h"
#include "UI.h"
#include <UI/布局.h>


C_Widget* f_ui_formProp创建纵向布局(S_UI创建环境& ctx, std::vector<S_Props>& prop)
{
	auto R = new C_Widget();
	R->mf_布局Fun = f_VBOX布局;
	R->m_是否延展 = { true, true };

	std::vector<C_Widget*> ws;

	for (auto& e : prop) {
		C_Widget* w = 0;

		switch (e.m_Type)
		{
		case E_值类型::e_Type_I32: {
			w = f_ui_创建数值编辑框(ctx, e);
			break;
		}
		case E_值类型::e_Type_RGBA8: {
			w = f_ui_创建颜色选框(ctx, e);
			break;
		}
		default:
			break;
		}

		w->m_是否延展 = { true, false };
		R->f_添加子组件(w);
	}

	return R;
}














